package com.dyh.quickdemo.demos.transer;


import org.springframework.beans.BeanUtils;

public interface LayerTranser {


    static <I,O> O trans(I i,Class<O> cls){
        O o = null;
        if (i==null)
            return o;
        try {
            o = cls.newInstance();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        BeanUtils.copyProperties(i,o);
        return o;
    }
}
